/**
 * 版权所有 2009-2015 中国中医科学院中医药信息研究所 何前锋 frontpeak@yahoo.com.cn
 **/
package cn.ac.cintcm.sh.dao;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import cn.ac.cintcm.sh.domain.Alia;

public class AliasDao {
    
    public List<Alia> getAlias() {
        String sql="select * from herbalias";
        HsqldbDao dao = (new HsqldbDao()).getDao();
        List<Alia> alias = new ArrayList<Alia>();
        dao.openConnection();
        ResultSet rs = dao.executeQuery(sql);
        try{
            while(rs.next()){
                String zhengming=rs.getString("zhengming");
                String yiming = rs.getString("yiming");
                Alia a = new Alia(zhengming, yiming);
                alias.add(a);
            }
        }catch(Exception e){
            e.printStackTrace();
        }
        dao.closeConnection();
        return alias;
    }

}